import request from '@/request/request';
import qs from 'qs';
export const jinpinAPI = () => request.get('/products/recommend');
export const hotAPI = () => request.get('/products/hot');
export const sendSMSApi = params => request.post('/sendSMS', qs.stringify(params));
export const phoneLogin = params => request.post('/phoneRegin', qs.stringify(params));
export const weixinLoginAPI = params => request.post('/wechatUsers/PCLogin', qs.stringify(params));
export const bindingPhoneAPI = params => request.post('/wechatUsers/binding', qs.stringify(params));
//获取用户信息
export const userInfoAPI = () => request.get('/shop/userProfiles');
//商品详情请求
export const GoodsDetailsAPI = id => request.get(`/products/${id}`);
//加入购物车
export const addToCartAPI = params => request.post('/shop/carts/add', qs.stringify(params));
//请求全部商品
export const GoodsSearchsAPI = params => request.get(`/products`, { params });
//查看购物车
export const shopCartAPI = () => request.get('/shop/carts');
//删除购物车
export const deleteCartAPI = params => request.delete(`/shop/carts?productIds=${params.id}`);
